package com.wgz.medicalmanagement.domain.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import lombok.Data;

/**
 * 药品实体类
 * 
 * @author medical
 * @since 2023-05-29
 */
@Data
@Entity
@Table(name = "medicines")
@TableName("medicines")
public class Medicine implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 药品名称
     */
    @Column(name = "name", nullable = false)
    @TableField("name")
    private String name;

    /**
     * 规格
     */
    @Column(name = "specification")
    @TableField("specification")
    private String specification;

    /**
     * 生产厂家
     */
    @Column(name = "manufacturer")
    @TableField("manufacturer")
    private String manufacturer;

    /**
     * 类别
     */
    @Column(name = "category")
    @TableField("category")
    private String category;

    /**
     * 单位
     */
    @Column(name = "unit")
    @TableField("unit")
    private String unit;

    /**
     * 价格
     */
    @Column(name = "price", precision = 10, scale = 2)
    @TableField("price")
    private BigDecimal price;

    /**
     * 库存
     */
    @Column(name = "stock")
    @TableField("stock")
    private Integer stock;

    /**
     * 描述
     */
    @Column(name = "description", columnDefinition = "text")
    @TableField("description")
    private String description;

    /**
     * 创建时间
     */
    @Column(name = "created_time")
    @TableField("created_time")
    private LocalDateTime createdTime;

    /**
     * 更新时间
     */
    @Column(name = "updated_time")
    @TableField("updated_time")
    private LocalDateTime updatedTime;

    /**
     * 是否删除(0:否,1:是)
     */
    @Column(name = "deleted")
    @TableField("deleted")
    @TableLogic
    private Integer deleted;
} 